package org.secangkirkopipanas.gxtcore.server.domain;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import net.sf.hibernate4gwt.pojo.java5.LazyPojo;

import org.secangkirkopipanas.gxtcore.domain.ISystemVisit;

@Entity
@Table(name = "sys_visit")
public class SystemVisit extends LazyPojo implements Serializable, ISystemVisit {

	private static final long serialVersionUID = 1L;

	@Id
	@Column(name = "id", nullable = false, insertable = true, updatable = true)
	@GeneratedValue(strategy = GenerationType.AUTO)
	private long id;

	@Column(name = "username", length = 25, nullable = false, insertable = true, updatable = true)
	private String username;

	@Column(name = "ip_address", length = 15, nullable = false, insertable = true, updatable = true)
	private String ipAddress;

	@Column(name = "access_time", nullable = false, insertable = true, updatable = true)
	private Date accessTime;

	@Column(name = "session_key", length = 64, nullable = false, insertable = true, updatable = true)
	private String sessionKey;

	public SystemVisit() {
	}

	public SystemVisit(String loginName, String ipAddress, Date accessTime,
			String sessionKey) {
		this.username = loginName;
		this.ipAddress = ipAddress;
		this.accessTime = accessTime;
		this.sessionKey = sessionKey;
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getUsername() {
		return username;
	}

	public String getIpAddress() {
		return ipAddress;
	}

	public void setIpAddress(String ipAddress) {
		this.ipAddress = ipAddress;
	}

	public Date getAccessTime() {
		return accessTime;
	}

	public void setAccessTime(Date timestamp) {
		this.accessTime = timestamp;
	}

	public String getSessionKey() {
		return sessionKey;
	}

	public void setSessionKey(String sessionKey) {
		this.sessionKey = sessionKey;
	}

}
